
#ifndef ENEMY_H
#define ENEMY_H


#include <QObject>
#include<QGraphicsItem>
#include"character.h"
#include<QTimer>
#include<QMediaPlayer>
#include<QAudioOutput>

class Enemy : public QObject
{
    Q_OBJECT
public:
    Enemy(QString pixPath,qreal scale,QString apixPath=" ",QString m1Path=" ",QString m2Path=" ",QString aPath=" ",int madd=1,int aadd=1,QString beUrl=" ",QString fUrl=" ",int eflag=0,QString a1Url=" ",QString a2Url=" ",QString a3Url=" ");
    QGraphicsPixmapItem* enemy;
    int health;
    int damage;
    int width;
    int height;
    QString oPixPath;
    QString aPixPath;
    QString move1Path;
    QString move2Path;
    QString attackPath;
    QString beattackUrl;
    QString attackUrl1;
    QString attackUrl2;
    QString attackUrl3;
    QString failUrl;
    int dest;
    int dx;
    static int moveflag;
    int moveAddition;
    int attackAddition;
    int enemyflag;
    bool isAlive=1;

    QMediaPlayer* beattack;
    QMediaPlayer* beattacked;
    QMediaPlayer* attack1;
    QMediaPlayer* attack2;
    QMediaPlayer* attack3;
    QMediaPlayer* fail;
    QAudioOutput* output;

    QRectF boundingRect() const;

    void attack(Character*);
    QTimer* attackTimer;

    void move(Character* lumine);
    QTimer* moveTimer;

signals:
    void notice();
    void failed();
};

#endif // ENEMY_H
